<script setup>
import { ref, watch } from 'vue'
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'
const list = ref([
  {
    type: '鸟类',
    id: 'A001',
    height: '89',
    speed: '15.1'
  },
  {
    type: '滑翔伞',
    id: 'A002',
    height: '188',
    speed: '7.7'
  },
  {
    type: '无人机',
    id: 'A003',
    height: '52',
    speed: '8.9'
  },
  {
    type: '鸟类',
    id: 'A004',
    height: '159',
    speed: '15.6'
  },
  {
    type: '鸟类',
    id: 'A005',
    height: '279',
    speed: '16.1'
  },
  {
    type: '无人机',
    id: 'A006',
    height: '112',
    speed: '10.3'
  },
  {
    type: '鸟类',
    id: 'A007',
    height: '224',
    speed: '15.6'
  },
  {
    type: '鸟类',
    id: 'A008',
    height: '224',
    speed: '17.1'
  },
  {
    type: '直升机',
    id: 'A009',
    height: '368',
    speed: '42.1'
  },
  {
    type: '鸟类',
    id: 'A010',
    height: '139',
    speed: '16.3'
  }
])
</script>
<template>
  <div class="card">
    <CommonTitle title="目标信息" />
    <div class="table">
      <ul class="thead">
        <li>类型</li>
        <li>ID</li>
        <li>高度(m)</li>
        <li>速度(m/s)</li>
      </ul>
      <ul class="tbody">
        <vue3-seamless-scroll
          :list="list"
          :step="0.3"
          :hover="true"
          :isRemUnit="true"
          :wheel="true"
          :delay="3"
          :limitScrollNum="6"
        >
          <li v-for="(item, index) in list" :key="index">
            <p>
              <span class="type">{{ item.type }}</span>
            </p>
            <p>{{ item.id }}</p>
            <p>
              {{ item.height }}
            </p>
            <p>
              {{ item.speed }}
            </p>
          </li>
        </vue3-seamless-scroll>
      </ul>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.card {
  margin-top: 15px;

  .table {
    width: 100%;
    padding: 10px;

    .thead {
      width: 100%;
      height: 37px;
      display: flex;
      background: url('@img/infrastructure/table_header_bg.png');
      background-size: 100% 100%;

      li {
        flex: 1;
        line-height: 37px;
        text-align: center;

        &:nth-child(2) {
          flex: 0 0 80px;
        }
      }
    }

    .tbody {
      height: 260px;
      overflow: hidden;

      li {
        display: flex;
        height: 37px;
        line-height: 37px;
        border-bottom: 1px solid #0f496c;

        &:nth-child(odd) {
          background-color: rgba(15, 73, 108, 0.3);
        }

        P {
          flex: 1;
          display: flex;
          justify-content: center;
          align-items: center;

          &:nth-child(2) {
            flex: 0 0 80px;
            overflow: hidden;
            span {
              display: block;
              width: 100%;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            }
          }

          .type {
            width: 67px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            background: rgba(0, 213, 255, 0.25);
            border-radius: 2px;
            border: 1px solid #00d5ff;
          }
        }
      }
    }

    .top-item {
      width: 20px;
      height: 20px;
      background: url('@img/management/top-item-bg.png');
      background-size: 100% 100%;
      text-align: center;
      color: #fff;
      font-family:
        PingFangSC,
        PingFang SC;
      font-size: 12px;
      line-height: 20px;
    }

    .bottom-item {
      width: 20px;
      height: 20px;
      background: url('@img/management/bottom-item-bg.png');
      background-size: 100% 100%;
      text-align: center;
      color: #fff;
      font-family: PingFang SC;
      font-weight: 400;
      font-size: 12px;
      line-height: 20px;
    }

    .view {
      display: flex;
      justify-content: start;
      align-items: center;
      color: #00d5ff;
      cursor: pointer;

      img {
        display: block;
        height: 15px;
      }
    }
  }
}

.transparent-table {
  font-size: 12px;
}
</style>
